package com.scau.wuwei.library_system.core.service.impl;

import com.scau.wuwei.library_system.core.bean.UserInfo;
import com.scau.wuwei.library_system.core.repository.UserInfoRepository;
import com.scau.wuwei.library_system.core.service.UserInfoService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class UserInfoServiceImpl implements UserInfoService {

    @Resource
    private UserInfoRepository userInfoRepository;

    @Override
    public UserInfo findByName(String name) {
        UserInfo userInfo = userInfoRepository.findByName(name);
        System.out.println("UserInfoServiceImpl.findByName() " + userInfo.getName() );

        return userInfo;
    }

    @Override
    public List<UserInfo> findByUsername(String username) {
        List<UserInfo> userList = userInfoRepository.findByUsername(username);
        System.out.print("UserInfoServiceImpl.findByUserName()" );
        return userList;
    }
}
